package org.authsum.stitches.wicket;

import java.util.ArrayList;
import java.util.List;
import org.authsum.stitches.wicket.pages.*;
import org.apache.wicket.PageParameters;
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;
import org.authsum.stitches.wicket.contentdef.ContentDefsPanel;
import org.authsum.stitches.wicket.content.*;
import org.authsum.stitches.wicket.contentversion.*;
import org.authsum.stitches.wicket.nearbys.*;
/**
 * Homepage
 */
public class HomePage extends BasePage {

	private static final long serialVersionUID = 1L;


	public HomePage(final PageParameters parameters) {
		super(parameters);
		// Add the simplest type of label
		add(new Label("message",
				"If you see this message wicket is properly configured and running"));

		List tabs = new ArrayList();
		tabs.add(new AbstractTab(new Model("Stitches Home")) {
			public Panel getPanel(String panelId) {
				return new HomePanel(panelId);
			}
		});

		tabs.add(new AbstractTab(new Model("Content Definitions")) {
			public Panel getPanel(String panelId) {
				return new ContentDefsPanel(panelId);
			}
		});
		tabs.add(new AbstractTab(new Model("Content")) {
			public Panel getPanel(String panelId) {
				return new ContentsPanel(panelId);
			}
		});
		tabs.add(new AbstractTab(new Model("Content Versions")) {
			public Panel getPanel(String panelId) {
				return new ContentVersionsPanel(panelId);
			}
		});
		tabs.add(new AbstractTab(new Model("Attribute Values")) {
			public Panel getPanel(String panelId) {
				return new ContentsPanel(panelId);
			}
		});
		tabs.add(new AbstractTab(new Model("Search")) {
			public Panel getPanel(String panelId) {
				return new ContentsPanel(panelId);
			}
		});
		tabs.add(new AbstractTab(new Model("Advanced")) {
			public Panel getPanel(String panelId) {
				return new ContentsPanel(panelId);
			}
		});
		tabs.add(new AbstractTab(new Model("Geosearch with Google Map")) {
			public Panel getPanel(String panelId) {
				return new GeoSearchPanel(panelId);
			}
		});
		
		TabbedPanel  tabbedPanel = new TabbedPanel("tabs", tabs);
		
		tabbedPanel.setSelectedTab(7);
		add(tabbedPanel);

		//add( new GeoSearchPanel("gmaptest"));
	}


}
